<template>
    <div>
        <!--        头部固定定位logo-->
        <tophead active="1"></tophead>
<!--         图片-->
        <div class="img-box">
            <img src="../../assets/productImg/banner.jpg" alt="">
        </div>
<!--        正文-->
        <div class="text-box">
            <div class="title-box">
                <div class="title-link" >
                    <router-link tag="span" to="/index">首页</router-link>
                    <span>></span>
                    <router-link tag="span" to="/product">产品详情</router-link>
                </div>
                <div class="title-time">
                    <i class="el-icon-time"></i>
                    <span v-html="detail.time"></span>
                </div>
            </div>
            <div class="icon">
                <router-link to="/product">
                    <i class="el-icon-s-grid"></i>
                </router-link>
            </div>
            <div class="text">
                <h2 v-html="detail.name"></h2>
                <div class="detail_text" v-html="detail.details">

                </div>
            </div>
        </div>
        <!--        底部-->
        <foot></foot>
    </div>
</template>

<script>
    import top from "../../mixin/index";
    import {getProductList2} from "../../api";
    export default {
        name: "productDetail",
        mixins:[top],
        data(){
            return{
               detail:""//富文本
            }
        },
        created() {
            getProductList2(this.$route.query.id).then(res=>{
                console.log(res);
                this.detail=res.data
            })
        }
    }
</script>

<style scoped lang="less">
    .text {
        h2 {
            text-align: center;
            margin-bottom: 30px;
        }
    }
.img-box {
    margin-top: 75px;
    img {
        width: 100%;
    }
}
.icon {
    position: relative;
    height: 40px;
    i {
        position: absolute;
        right: 0;
        top: 30%;
        color: #999;
        font-size: 26px;
        cursor: pointer;
    }
}
.title-time{
    span {
        padding-left: 10px;
    }
}
.text-box {
    border-bottom: 1px solid #999;
    margin-bottom: 40px;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    width: 1170px;
    .title-box {
        padding: 20px 0;
        color: #8d8d8d;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px dashed #c8c8c8;
        span {
            cursor: pointer;
        }
    }
}
</style>